$(function () {
    var url = window.location.href;
    var argsIndex = url.split("?openid=");
    var openid = argsIndex[1];
    $.ajax({
        type: "GET",
        url: '/user/get-user-watch?openid=' + openid,
        crossDomain: true,
        success: function (result) {
            if (result.code === "0") {
                $("#watch-list").append(tpl(document.getElementById('watch-tpl').innerHTML, result.data));
            } else {
                $.toast.prototype.defaults.duration = 1000;//1秒
                $.toast(result.message, 'text');
            }
        },
        error: function () {
            $.toast.prototype.defaults.duration = 1000;//1秒
            $.toast("无网络", 'text');
        }
    });
});